package com.example.jms;

import org.apache.camel.Consume;
import org.apache.camel.Header;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.domain.Book;
import com.example.service.BookService;
import com.example.util.FileIO;



@Service
public class AccepetJms {
	@Autowired
	BookService bs;
	//@Consume(uri = "jms:queue:testexample?concurrentConsumers=20")
	public void accept(@Header("mobileid") String mobileid){
		String str="accept mobile is:"+mobileid;
		Book book=new Book();
		book.setName("id"+mobileid);
		book.setPrice(Long.valueOf(mobileid));
		 bs.save(book);
		FileIO.print("F:\\tt.txt", str, true);
		System.out.println(str);
	}
}
